package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TourismBannerMapper;
import com.ruoyi.system.domain.TourismBanner;
import com.ruoyi.system.service.ITourismBannerService;

/**
 * 轮播图Service业务层处理
 * 
 * @author gqd
 * @date 2020-12-23
 */
@Service
public class TourismBannerServiceImpl implements ITourismBannerService 
{
    @Autowired
    private TourismBannerMapper tourismBannerMapper;

    /**
     * 查询轮播图
     * 
     * @param id 轮播图ID
     * @return 轮播图
     */
    @Override
    public TourismBanner selectTourismBannerById(Integer id)
    {
        return tourismBannerMapper.selectTourismBannerById(id);
    }

    /**
     * 查询轮播图列表
     * 
     * @param tourismBanner 轮播图
     * @return 轮播图
     */
    @Override
    public List<TourismBanner> selectTourismBannerList(TourismBanner tourismBanner)
    {
        return tourismBannerMapper.selectTourismBannerList(tourismBanner);
    }

    /**
     * 新增轮播图
     * 
     * @param tourismBanner 轮播图
     * @return 结果
     */
    @Override
    public int insertTourismBanner(TourismBanner tourismBanner)
    {
        tourismBanner.setCreateTime(DateUtils.getNowDate());
        return tourismBannerMapper.insertTourismBanner(tourismBanner);
    }

    /**
     * 修改轮播图
     * 
     * @param tourismBanner 轮播图
     * @return 结果
     */
    @Override
    public int updateTourismBanner(TourismBanner tourismBanner)
    {
        tourismBanner.setUpdateTime(DateUtils.getNowDate());
        return tourismBannerMapper.updateTourismBanner(tourismBanner);
    }

    /**
     * 批量删除轮播图
     * 
     * @param ids 需要删除的轮播图ID
     * @return 结果
     */
    @Override
    public int deleteTourismBannerByIds(Integer[] ids)
    {
        return tourismBannerMapper.deleteTourismBannerByIds(ids);
    }

    /**
     * 删除轮播图信息
     * 
     * @param id 轮播图ID
     * @return 结果
     */
    @Override
    public int deleteTourismBannerById(Integer id)
    {
        return tourismBannerMapper.deleteTourismBannerById(id);
    }
}
